package com.pulse.base.service.impl;

import com.pulse.base.domain.UserTestParam;
import com.pulse.base.mapper.UserTestParamMapper;
import com.pulse.base.service.IUserTestParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserTestParamServiceImpl implements IUserTestParamService {

    @Autowired
    private UserTestParamMapper userTestParamMapper;

    /**
     * 根据设备编号和端口查询
     *
     * @param deviceNo
     * @param channel
     * @return
     */
    @Override
    public UserTestParam getTestParam(String deviceNo, Integer channel) {
        return userTestParamMapper.selectUserTestParamByDeviceNoAndChannel(deviceNo,channel);
    }

    /**
     * 新增
     *
     * @param userTestParam
     * @return
     */
    @Override
    public int insertUserTestParam(UserTestParam userTestParam) {
        return userTestParamMapper.insertUserTestParam(userTestParam);
    }

    /**
     * 修改
     *
     * @param userTestParam
     * @return
     */
    @Override
    public int updateUserTestParam(UserTestParam userTestParam) {
        return userTestParamMapper.updateUserTestParam(userTestParam);
    }

    /**
     * 根号设备编号删除
     *
     * @param deviceNo
     * @return
     */
    @Override
    public int deleteByDeviceNo(String deviceNo) {
        return userTestParamMapper.deleteUserTestParamByDeviceNo(deviceNo);
    }
}
